Security News
Fluent Assertions Faces Backlash After Abandoning Open Source Licensing
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
Template functions to generate TypeScript AST, inspired from @babel/template .
$ npm i talt typescript
import ts from "typescript";
import { template } from "talt";
const typeNode = template.typeNode("{ readonly hoge: string }")();
// You can use `template` as tag function.
const typeNodeUsingTagFn = template.typeNode`
{
readonly hoge: string;
}
`();
// The following returns ts.BinaryExpression
const binaryExpression = template.expression<ts.BinaryExpression>("60 * 1000")();
// You can use identifier placeholder.
const compiledFn = template.expression`
60 * SOME_PLACEHOLDER_KEY
`;
const generatedAst = compiledFn({
SOME_PLACEHOLDER_KEY: binaryExpression,
}); // returns expression node, `60 * 60 * 1000`
const generetedOtherNode = compiledFn({
SOME_PLACEHOLDER_KEY: ts.factory.createNumericLiteral("200"),
}); // returns expression node, `60 * 200`
// You can use any function which returns ts.Node instead of identifier placeholder.
const altCompiledFn = template.expression`
60 * ${() => binaryExpression}
`; // returns expression node, `60 * 60 * 1000`
template
has the following tag functions. Each tag function compiles and provides corresponding type AST.
template.typeNode
template.expression
template.statement
template.sourceFile
template.jsxAttribute
MIT
FAQs
Template functions to generate TypeScript AST.
The npm package talt receives a total of 19,592 weekly downloads. As such, talt popularity was classified as popular.
We found that talt demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Security News
Fluent Assertions is facing backlash after dropping the Apache license for a commercial model, leaving users blindsided and questioning contributor rights.
Research
Security News
Socket researchers uncover the risks of a malicious Python package targeting Discord developers.
Security News
The UK is proposing a bold ban on ransomware payments by public entities to disrupt cybercrime, protect critical services, and lead global cybersecurity efforts.